/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: VP Development
 * License Type: Purchased
 */
using System;
using System.Collections;
using Orm.Criteria;
using Orm;
using NHibernate;

namespace petshop {
	public class CustomerCriteria : AbstractORMCriteria {
		private StringExpression _name;
		public StringExpression Name {
			get {
				return  _name;
			}
			
		}
		
		private StringExpression _telephone;
		public StringExpression Telephone {
			get {
				return  _telephone;
			}
			
		}
		
		private StringExpression _address;
		public StringExpression Address {
			get {
				return  _address;
			}
			
		}
		
		private Int32Expression _ID;
		public Int32Expression ID {
			get {
				return  _ID;
			}
			
		}
		
		public CustomerCriteria(ICriteria criteria) : base(criteria) {
			_name =  new StringExpression("Name", this);
			_telephone =  new StringExpression("Telephone", this);
			_address =  new StringExpression("Address", this);
			_ID =  new Int32Expression("ID", this);
		}
		
		public CustomerCriteria(PersistentSession session) : this(session.CreateCriteria(typeof(Customer))) {
		}
		
		public CustomerCriteria() : this(global::petshop.PetShopPersistentManager.Instance().GetSession()) {
		}
		
		public TransactionCriteria CreateTransactionCriteria() {
			return new TransactionCriteria(CreateCriteria("transaction"));
		}
		
		public Customer UniqueCustomer() {
			return (Customer)base.UniqueResult();
		}
		
		public Customer[] ListCustomer() {
			IList lList = base.List();
			Customer[] lValues = new Customer[lList.Count];
			lList.CopyTo(lValues, 0);
			return lValues;
		}
		
	}
	
}

